<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>#springMessage("sysManagerTitle")</title> #parse("page_include.html")
</head>
<body>
	<div id="layoutId" data-type="layout" data-defs="fit:true">
		<div data-defs="region:'north',border:true" style="overflow-y: hidden; position: relative; height: 56px; padding: 0px">
			<table width="100%" height="100%" class="headbg">
				<tr height=56 width="100%">
					<td width="40%" class="headleftbg"></td>
					<td width="15%" align="right">
						<span style="color: #666633"><b>您好,&nbsp;${userName}</b></span>
					</td>
					<td width="25%">
						<div style="padding-top: 30px; padding-right: 1px; height: 100%; width: 100%">
							<a id="editButton" style="width: 88px; float: right;" href="javascript:void(0)" data-type="button" onclick="changePassword()"
								data-defs="iconCls:'icon-change-password',plain:true">密码修改</a>
							<a id="addButton" style="width: 88px; float: right;" href="${rc.contextPath}/j_spring_security_logout" data-type="button"
								data-defs="iconCls:'icon-logout',plain:true">注销</a>
							<a href="#" onclick="changeTheme('default')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-d'"></a>
							<a href="#" onclick="changeTheme('lightness')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-l'"></a>
							<a href="#" onclick="changeTheme('start')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-s'"></a>
							<a href="#" onclick="changeTheme('start2')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-g'"></a>
							<a href="#" onclick="changeTheme('pepperGrinder')" style="width: 18px; float: right;" data-type="button"
								data-defs="plain:true,iconCls:'icon-theme-p'"></a>
						</div>
					</td>
				</tr>
			</table>
		</div>
		<div data-defs="region:'west',split:true,border:false,headerType:'accordion'" title="菜单信息"
			style="width: 230px; padding: 0px;">
			<div data-type="accordion" data-defs="fit:true,border:true">
				#foreach($menuInfoDTO in $menuInfoList)
				<div title="${menuInfoDTO.menuName}" data-defs="selected:true" style="padding: 5px">
					<ul data-type="tree" style="padding: 2px"
						data-defs="
					method:'post',
					onClick : tree1OnClickFun,
					url:'${rc.contextPath}/getTreeFormAccording.do?menuId=${menuInfoDTO.menuId}',
					animate:false,dnd:false"></ul>
				</div>
				#end
			</div>
		</div>
		<div id="centerId" data-defs="region:'center',title:'',border:true" style="padding: 0px;">
			<div id="bsTabs" data-type="tabs" data-defs="resizePanel:false,fit:true,border:true,onContextMenu:tabMenuClick">
				<div title="欢迎页面" data-defs="iconCls:'icon-help',closable:false" style="padding: 10px;"
					href="${rc.contextPath}/assets/ui/jww/jwwui.html"></div>
			</div>
		</div>
		<div data-defs="region:'south',border:false,split:true,bodyCls:'byl byr bnb byt'" style="height: 36px; padding: 1px;">
			<div align="center" style="padding-top: 5px;">版权所有......</div>
		</div>
	</div>
	<div id="change_password_window" data-type="window" data-defs="modal:true,closed:true,iconCls:'icon-edit'"
		style="width: 600px; height: 300px; padding: 10px;">
		<form id="passwordForm" method="post">
			<table class="stable" cellpadding="1" cellspacing="1" style="width: 100%">
				<tr>
					<!-- 旧密码 -->
					<td width="25%" class="stdlabel">#springMessage("oldPassword")</td>
					<td width="75%" class="stdinput">
						<input data-type="inputbox" type="password" invalidMessage="#springMessage('unValidPassword')"
							name="loginPassword" style="width: 500px" data-defs="required:true"
							validType="remote['${rc.contextPath}/admin/checkPassword.do','loginPassword']"></input>
					</td>
				</tr>
				<tr>
					<!-- 新密码 -->
					<td width="25%" class="stdlabel">#springMessage("newPassword")</td>
					<td width="75%" class="stdinput">
						<input id="newPassword" data-type="inputbox" type="password" name="newPassword" style="width: 500px"
							data-defs="required:true"></input>
					</td>
				</tr>
				<tr>
					<!-- 确认新密码 -->
					<td width="25%" class="stdlabel">#springMessage("newPasswordConfirm")</td>
					<td width="75%" class="stdinput">
						<input data-type="inputbox" type="password" name="newPasswordConfirm" style="width: 500px"
							data-defs="required:true,validType:'equals[\'#newPassword\']'"></input>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<div style="margin: 0px 0; padding-top: 5px;" align="center">
							<a onclick="saveFun()" href="#" data-type="button" data-defs="iconCls:'icon-save'">
								#springMessage("buttonSave") </a>
							<a onclick="closeFun()" href="#" data-type="button" data-defs="iconCls:'icon-close'">
								#springMessage("buttonClose") </a>
						</div>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<script type="text/javascript">
		$(document).ready(function() {
	        $.extend($.fn.inputbox.defaults.rules, {
		        equals : {
		            validator : function(value, param) {
			            return value == $(param[0]).val();
		            },
		            message : '#springMessage("passwordNotMatch")'
		        }
	        });
        });
        function tree1OnClickFun(node) {
	        if (node.attributes) {
		        //ajaxLoading();
		        //可以自己加类似于panel的loading标志
		        var url = "${rc.contextPath}" + node.attributes.url;
		        //$("#demoIframe").attr("src", url);
		        addTab(node.text, url, '');
	        }
        }
        function changeTheme(themeId) {
	        if (themeId == null || themeId == "") {
		        return;
	        }
	        var url = '${rc.contextPath}/admin/updateTheme.do';
	        var data = {
		        "themeId" : themeId
	        };
	        ajaxPost(url, data, function(rs) {
		        showMsg(rs.msgInfo);
		        window.location.reload();
	        });
        }
        function changePassword() {
	        var options = {
	            "windowId" : "change_password_window",
	            "title" : "#springMessage('changePasswordTitle')"
	        };
	        openWindow(options);
	        $("#userForm").form('clear');
        }
        //保存人员基本信息
        function saveFun() {
	        var url = "${rc.contextPath}/admin/updatePassword.do";
	        var v = $("#change_password_window").form('validate');
	        if (!v) {
		        return;
	        }
	        submitForm("passwordForm", url, function(rs) {
		        var returnedObj = $.parseJSON(rs);
		        showMsg(returnedObj.msgInfo);
	        });
        }
        function closeFun() {
	        $("#change_password_window").window("close");
        }
        function tabMenuClick(e, title, index) {
	        e.preventDefault();
	        $('#mm').menu('show', {
	            left : e.pageX,
	            top : e.pageY,
	            property : {
		            title : title
	            }
	        });
        }
        function menuHandler(item, o) {
	        if (item.text == "关闭") {
		        $('#bsTabs').tabs('close', o.property.title);
	        } else if (item.text == "关闭所有") {
		        $('#bsTabs').tabs('closeAll');
	        } else if (item.text == "关闭其它") {
		        $('#bsTabs').tabs('closeOthers', o.property.title);
	        }
        }
	</script>
</body>
</html>